A network processor may include a memory for receiving and storing data provided to the network processor. The memory may be coupled to one or more physical layer interfaces via a memory subsystem (e.g., a transmit buffer) and a link layer device, such as a network controller, for example, included in the network processor. In a conventional network processor a separate transmit buffer is provided for each physical layer interface and, the network processor transmits data for a port from the memory to the transmit buffer associated with the physical layer interface that includes the port. Thereafter, the transmit buffer transmits the data to the port via one of a plurality of physical layer devices included in the physical layer interface. The physical layer device may include an internal buffer for storing data received from the transmit buffer.
The network processor typically may receive data for one or more of the ports independently of the availability of the one or more ports. Likewise, one or more of the ports may be available to receive data independently of whether the network processor receives data for the one or more ports.
Multiple ports typically may share a physical layer interface. More specifically, the packets to be transmitted to the multiple ports, respectively, are interleaved such that each port may transmit a portion of a corresponding packet during the same time frame. However, only one port may use the physical layer interface at a time (e.g., to receive data from the transmit buffer corresponding to the physical layer and/or to transmit data from the network processor). Therefore, if the amount of data transmitted from a transmit buffer to the one or more ports is managed improperly, the network processor may inaccurately and/or inefficiently transmit data from the one or more ports.
More specifically, if a transmit buffer sends data to a port included in a physical layer device, and the data causes an internal buffer corresponding to a port of the physical layer device to exceed a first predetermined level (e.g., a high watermark), the physical layer device may notify the transmit buffer to stop sending data to the physical layer device until enough data of the internal buffer has been transmitted from the port to accommodate the new data. While the port is transmitting data and reducing the amount of data stored in the internal buffer corresponding to the port, the remaining ports included in the physical layer device stall (e.g., may not transmit data). Such stalling may cause one or more of the remaining ports to underrun (e.g., during the transmission of a data frame or cell, a port may not receive an expected portion of the data frame or cell in a timely fashion). Because of an underrun, data may be inaccurately transmitted from a port and must be retransmitted. Such a retransmission of data consumes bandwidth that otherwise may be used for transmitting other data, thereby causing a loss of effective bandwidth on the line.
Likewise, if the data transmitted from a transmit buffer to the physical layer device is excessively managed, the transmission of data may not be pipelined, resulting in inefficient use of transmit buffer bandwidth. For example, in an attempt to avoid causing an underrun, single-threading of a packet may be used such that an entire packet is transmitted to a port before another packet is transmitted to another port. Because the packets to be transmitted to the ports, respectively, are not interleaved, only one packet is transmitted at a time which results in an inefficient use of transmit buffer bandwidth.